/**
*	bootstrap button 事件公共js模块
*   @Author jackson wang
*   @date 2016-09-022
*   @version 1.0
*
*/

define(["jquery",'bsUtil'], 
	function($,bsUtil) {
	
	'use strict';
	
	
							
	var rootid = 'oa-carapply';
	
	
	
	var public_method = {
		initElement:function(){
			var _start = $('#'+rootid + ' #go_car_time')
				var _end = $('#'+rootid + ' #plan_back_car_time')
				
				var _param ={
					language:  'zh-CN',
					format: "yyyy-mm-dd hh:ii:ss",
					autoclose: true,
					minView: "month",
					maxView: "decade",
					todayBtn: true,
					pickerPosition: "bottom-left"
				}
				
				if(_start.length==1){
					
					_start.datetimepicker(_param);
					
					if(_end.length==1){
						
						_start.on("click",function(ev){
							_start.datetimepicker("setEndDate", _end.val());
						})
						
						_end.datetimepicker(_param)
							.on("click", function (ev) {
								_end.datetimepicker("setStartDate", _start.val());
							})
					}
				}				
			
		}
	}
	
	
	
	return public_method;
})